/**
 * Created with hong.rong
 * Description:路由
 * Date:2020/06/21
 */

/**
 * 404页面路径
 * @type {string}
 */
export const NO_MATCH_PATH = '404'

/**
 * authority: 为[]表示所有角色都无权限, 不设authority表示所有角色都有权限
 */
export default [
  {
    path: '/login',
    component: 'login',
  },
  {
    path: '/',
    component: '@/layouts/BasicLayout',
    wrappers: ['@/utils/PrivateRoute'],
    routes: [
      {
        path: '/',
        redirect: '/dashboard',
      },
      {
        name: '首页',
        path: '/dashboard',
        icon: 'icon-dashboard',
        // authority: ['admin', 'user'],
        component: 'dashboard',
      },
      // 二级目录
      {
        name: '全局配置',
        path: '/config',
        icon: 'icon-caidan',
        routes: [
          {
            name: 'Banner管理',
            path: '/config/banner',
            component: 'config/banner',
          },
          {
            name: '类目管理',
            path: '/config/category',
            component: 'config/category',
          },
          {
            component: NO_MATCH_PATH,
          },
        ],
      },
      {
        name: '团购管理',
        path: '/groupBuy',
        icon: 'icon-caidan',
        component: 'groupBuy',
      },
      {
        name: '自提点管理',
        path: '/carryPosition',
        icon: 'icon-tupian',
        component: 'carryPosition',
      },
      {
        name: '订单管理',
        path: '/order',
        icon: 'icon-xiangmu',
        component: 'order',
      },
      {
        name: '佣金管理',
        path: '/commission',
        icon: 'icon-tupian',
        component: 'commission',
      },
      {
        name: '报表管理',
        path: '/reportManage',
        icon: 'icon-tupian',
        component: 'reportManage',
      },
      {
        hideInMenu: true,
        path: '/reportManage/groupBuy',
        component: 'reportManage/groupBuy',
      },
      {
        hideInMenu: true,
        path: '/reportManage/commander',
        component: 'reportManage/commander',
      },
      {
        hideInMenu: true,
        path: '/reportManage/commission',
        component: 'reportManage/commission',
      },
      {
        hideInMenu: true,
        path: '/reportManage/finance',
        component: 'reportManage/finance',
      },
      {
        component: NO_MATCH_PATH,
      },
    ],
  },
]
